const fs = require('fs');
const path = require('path');

const filePath = path.resolve(__dirname, '../package.json');
const json = require(filePath);

json.version = process.argv[2];

// 将修改后的内容写回package.json文件
fs.writeFileSync(filePath, JSON.stringify(json, null, 2));
